package com.kaifamiao.date1112;

public class PigeonTest {

	public static void main(String[] args) throws Exception {
		Pigeon p = new Pigeon( "白鸽" , 5 );
		System.out.println( p.getName() + " , " + p.getAge() );
		
		// 克隆对象
		Object o = p.clone();
		System.out.println( o.getClass() );
		if( o instanceof Pigeon x ) {
			System.out.println( x.getName() + " , " + x.getAge() );
			
			System.out.println( System.identityHashCode( p ) );
			System.out.println( System.identityHashCode( x ) );
			System.out.println( x == p );
		}
	}

}
